import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "products")
public class Product {
    @Id
    @Column(name = "商品ID")
    private String productId;
    
    @Column(name = "商品名称")
    private String name;
    
    @Column(name = "商品单价")
    private Float price;
    
    @Column(name = "进货批次")
    private String batch;
    
    @OneToMany(mappedBy = "product", cascade = CascadeType.ALL)
    private List<Sale> sales;
    
    @OneToMany(mappedBy = "product", cascade = CascadeType.ALL)
    private List<Purchase> purchases;
}